Platform Explorer / Nuxeo Platform 2023.10

Extension point negotiations

Documentation

The negotations extension point allows to define a list of Java classes that will compute the current page or current flavor to use, depending on the context.

Example:

    <negotiation target="jsfFlavor">
        <negotiator
            class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestParameter" order="10">
            <property name="param">flavor</property>
        </negotiator>
        <negotiator
            class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestAttribute" order="20">
            <property name="param">flavor</property>
        </negotiator>
        <negotiator class="org.nuxeo.ecm.localconf.LocalThemeFlavor" order="30">
            <property name="negotiatedPageVariable">jsfPage</property>
        </negotiator>
        <negotiator
            class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPageFlavor" order="100">
            <property name="negotiatedPageVariable">jsfPage</property>
        </negotiator>
    </negotiation>

Negotiator classes must implement the org.nuxeo.theme.styling.negotiation.Negotiator interface. The abstract class org.nuxeo.theme.styling.negotiation.AbstractNegotiator can be extended to benefit from generic implementation.

The context used in negotiator API can depend on the caller. In JSF default pages, this context will be the current JSF FacesContext.

@since 7.4

Contribution Descriptors

  • Class: org.nuxeo.theme.styling.service.descriptors.NegotiationDescriptor

Existing Contributions

Contributions are presented in the same order as the registration order on this extension point. This order is displayed before the contribution name, in brackets.

  • nuxeo-platform-webapp-core-2023.10.13.jar /OSGI-INF/theme-contrib.xml
    <extension point="negotiations" target="org.nuxeo.theme.styling.service">
    
        <negotiation target="jsfDefaultPage">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPage" order="100">
            <property name="jsfDefaultPage">galaxy/default</property>
          </negotiator>
        </negotiation>
    
        <negotiation target="jsfPage">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestParameter" order="10">
            <property name="param">page</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestAttribute" order="10">
            <property name="param">page</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPage" order="100">
            <property name="jsfPage">galaxy/default</property>
          </negotiator>
        </negotiation>
    
        <negotiation target="jsfFlavor">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestParameter" order="10">
            <property name="param">flavor</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.RequestAttribute" order="20">
            <property name="param">flavor</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.localconf.LocalThemeFlavor" order="30">
            <property name="negotiatedPageVariable">jsfPage</property>
          </negotiator>
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPageFlavor" order="100">
            <property name="negotiatedPageVariable">jsfPage</property>
          </negotiator>
        </negotiation>
    
      </extension>
  • nuxeo-theme-migration-2023.10.13.jar /OSGI-INF/theme-compat-framework.xml
    <extension point="negotiations" target="org.nuxeo.theme.styling.service">
        <negotiation target="jsfThemeCompatTemplate">
          <negotiator class="org.nuxeo.ecm.web.resources.jsf.negotiators.DefaultPage" order="100">
            <property name="jsfThemeCompatTemplate">/pages/workspace_page.xhtml</property>
          </negotiator>
        </negotiation>
      </extension>